<!-- 点击文字特效 -->
<script>
  blog.addLoadEvent(function() {
    var texts = [
      '富强',
      '民主',
      '文明',
      '和谐',
      '自由',
      '平等',
      '公正',
      '法治',
      '爱国',
      '敬业',
      '诚信',
      '友善'
    ]
    var temp = '<span style="top:{top}px;'
    temp += 'left:{left}px;'
    temp += 'font-size: 12px;'
    temp += 'width: 30px;'
    temp += 'z-index: 999;'
    temp += 'position: absolute;'
    temp += 'opacity: 1;'
    temp += 'user-select: none;'
    temp += '-webkit-user-select: none;'
    temp += 'transition: all 500ms ease-out;'
    temp += '-webkit-transition: all 500ms ease-out;"'
    temp += '>{text}</span>'

    blog.addEvent(window, 'click', function(ev) {
      var tagName = ev.target.tagName.toLocaleLowerCase()
      if (tagName == 'a') {
        return
      }
      var text = texts[parseInt(Math.random() * texts.length)]
      var html = temp.replace('{text}', text)
      html = html.replace('{top}', ev.pageY - 10)
      html = html.replace('{left}', ev.pageX - 10)

      var o = document.createElement('div')
      o.innerHTML = html
      var node = o.children[0]

      document.body.appendChild(node)
      o = null
      setTimeout(function() {
        node.style.top = ev.pageY - 50 + 'px'
        node.style.opacity = 0
      }, 20)

      setTimeout(function() {
        document.body.removeChild(node)
        node = null
      }, 500)
    })
  })
</script>
